package com.wyz.saas.common.set

abstract class AbstractAppSetDescriptorDouble : AbstractAppSetDescriptor<Double>() {
    override fun default(): Double {
        return 0.0
    }

    override fun validate(value: Any?): Boolean {
        if (value != null) {
            if (value is String) {
                try {
                    value.toDouble()
                    return true
                } catch (e: NumberFormatException) {

                }
            } else if (value is Double) {
                return true
            }
        }
        return false
    }
}